package com.yonyou.pmclouds.repeatwork.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.copyperson.entity.CopyPersonVO;
import com.yonyou.pmclouds.safetyrectification.relationuser.entity.RelationUserVO;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Table(name="pm_repeatwork")
@Setter
@Getter
/**
 * 复工单
 */
public class RepeatWorkVO extends SuperVO {

    /**
     * 常量
     */
    public static String BILLSTATUS = "billStatus";//单据状态
    public static final String PKPROJECT = "pkProject";
    public static final String REPEATDATE="repeatDate";
    public static final String REPEATREASON="repeatReason";

    public static final String CREATOR = "creator";
    public static final String CREATOR_NAME = "creatorName";
    public static final String PROJECT_NAME = "projectName";
    public static final String PROJECT_CODE = "projectCode";

    /**
     * 区分移动端操作构造不同的通知内容
     */
    public static final String OPERATION_ADD = "add";
    public static final String OPERATION_UPDATE = "update";
    public static final String OPERATION_PASS = "pass";
    public static final String OPERATION_RECTIFY = "rectify";

    /**
     * 数据库对应字段
     */
    @Id
    private String pkRepeatwork; //复工单主键
    private String pkTenant;//关联租户主键
    @NotNull
    private String pkProject; // 关联项目
    @NotNull
//    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    private Date repeatDate; //复工日期
    @NotNull
    private String repeatReason; // 复工说明
    private String billType;     //单据类型
    private Byte billStatus;     //单据状态
    private String creator;      //创建者
//    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    private Date creationtime;   //创建时间
    private String modifier;     //修改者
//    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    private Date modifytime;     //修改时间
    private BigDecimal longitude;//经度
    private BigDecimal latitude; //维度
    private String position;     //位置信息
    private Integer lasttotalstopdays; //上次累计停工天数(未将本轮的停工和复工计算的停工天数累计)

    /**
     * 前台页面显示字段
     */
    @Transient
    private String projectName;  //项目名称
    @Transient
    private String projectCode;  //项目编码
    @Transient
    private String[] pictures;   //照片
    @Transient
    private int picNum;//图片数量
    @Transient
    private String creatorName;  //制单人
    @Transient
    private String pictureAddress; // 照片真实地址(用于存储HTML形式)
    @Transient
    private String status;//单据展示状态
    @Transient
    private String orgName;//组织名 打印模板时用的
    @Transient
    private String strBillstatus; // 单据状态
    @Transient
    private List<CopyPersonVO> copyPersonVOList; //抄送人
    @Transient
    private String operation;//操作类型
    @Transient
    private Integer totalstopdays;//累计停工天数
}
